import http from '../..';

const prefix = '/meta/tasks';

/**
 * 获取种群鉴定桑基图
 * @param taskId 任务id
 * @param barcodeId
 * @param threshold value最小值
 * @returns
 */
export const getSankey = (taskId: string, barcodeId: string, threshold: number) =>
  http.get(`${prefix}/${taskId}/barcodes/${barcodeId}/species-tree?threshold=${threshold}`);

/**
 * 获取桑基图致病源/条件致病源
 * @param taskId 任务id
 * @param barcodeId
 * @returns
 */
export const getSankeyType = (taskId: string, barcodeId: string) =>
  http.get(`${prefix}/${taskId}/barcodes/${barcodeId}/pathogenic`);

/**
 * 获取种级别鉴定结果表
 * @param taskId 任务id
 * @param barcodeId
 * @returns
 */
export const getSpecies = (taskId: string, barcodeId: string) =>
  http.get(`${prefix}/${taskId}/barcodes/${barcodeId}/table`);

/**
 * 获取亚种鉴定结果表
 * @param taskId 任务id
 * @param barcodeId
 * @returns
 */
export const getSubspecies = (taskId: string, barcodeId: string) =>
  http.get(`${prefix}/${taskId}/barcodes/${barcodeId}/sub_table`);

/**
 * 获取数据统计列表
 * @param taskId 任务id
 * @param barcodeId
 * @returns
 */
export const getNanoStats = (taskId: string, barcodeId: string) =>
  http.get(`${prefix}/${taskId}/barcodes/${barcodeId}/nano-stats`);

/**
 * 获取耐药元件分析列表
 * @param taskId 任务id
 * @param barcodeId
 * @returns
 */
export const getRgiData = (taskId: string, barcodeId: string) =>
  http.get(`${prefix}/${taskId}/barcodes/${barcodeId}/rgi/table`);

/**
 * 获取毒力分析列表
 * @param taskId 任务id
 * @param barcodeId
 * @returns
 */
export const getDrugData = (taskId: string, barcodeId: string) =>
  http.get(`${prefix}/${taskId}/barcodes/${barcodeId}/vf/table`);
